<?php get_header(); ?>
<!-- Mainbar -->
   <div class="mainbar">
    <div class="mainbar_top">
        <div class="mainbar_bottom">
            <div class="mainbar_inner">
    <?php if (have_posts()) : ?>
    
		<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
		<?php /* If this is a category archive */ if (is_category()) { ?>				
		<h1 class="search_results">Arquivo para a categoría '<?php echo single_cat_title(); ?>'</h1>
		
		<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
		<h1 class="search_results">Arquivo para <?php the_time('j, m, Y'); ?></h1>
		
		<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
		<h1 class="search_results">Arquivo para <?php the_time('m, Y'); ?></h1>

		<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
		<h1 class="search_results">Arquivo para <?php the_time('Y'); ?></h1>
		
		<?php /* If this is a search */ } elseif (is_search()) { ?>
		<h1 class="search_results">Resultados da busca</h1>
		
		<?php /* If this is an author archive */ } elseif (is_author()) { ?>
		<h1 class="search_results">Arquivos do autor</h1>

		<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
		<h1 class="search_results">Arquivos do blog</h1>

		<?php } ?>
               
      <?php while (have_posts()) : the_post(); ?>
        
        <div class="post <?php if(is_home() && $post==$posts[0] && !is_paged()) echo ' firstpost';?>">
            <div class="post_date">
                <div class="post_date_top"><?php the_time('d')?></div>
                <div class="post_date_bottom"><?php the_time('M') ?></div>                                            
            </div>
            <h2 class="post_header" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Enlace permanente a <?php the_title(); ?>"><?php the_title(); ?></a></h2>
            <div class="post_line"></div>
            <div class="post_content">
                <?php the_content('Ler mais...'); ?> 
                <!--
                <?php trackback_rdf(); ?>
                -->
            </div>
            <div class="post_data">
            Escrito por <?php the_author() ?> en <?php the_category(',') ?> e tem <?php comments_popup_link('Nenhum comentarios', '(1) Comentario', '(%) Comentarios'); ?> <?php edit_post_link('Editar',''); ?>
            </div>  
        </div>
        
        <?php endwhile; ?>
		<div class="navigation">
			<div class="alignleft"><?php posts_nav_link('','','&laquo; Entradas anteriores') ?></div>
			<div class="alignright"><?php posts_nav_link('','Entradas recentes &raquo;','') ?></div>
		</div>
		<?php else : ?>

		<h1 class="search_results">Nada encontrado</h1>
		

	<?php endif; ?>
		
	                
            </div>
        </div>
    </div>
</div>  

<?php get_sidebar(); ?>
<?php get_footer(); ?>